﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
//using Microsoft.Practices.EnterpriseLibrary.Validation;
//using Microsoft.Practices.EnterpriseLibrary.Validation.Validators;

namespace SharedGenomics.Workbench.PresentationModel
{
    public class SnpMarkerInfo
    {
        public override bool Equals(object obj)
        {
            SnpMarkerInfo comp = obj as SnpMarkerInfo;

            return (comp != null &&
                    String.Equals(this.MarkerName, comp.MarkerName) &&
                    String.Equals(this.RsNumber, comp.RsNumber) &&
                    String.Equals(this.Chromosome, comp.Chromosome) &&
                    String.Equals(this.Position, comp.Position));
        }

        public override int GetHashCode()
        {
            int hashCode = 1;

            unchecked
            {
                hashCode = ((this.MarkerName == null) ? 1 : this.MarkerName.GetHashCode()) *
                            ((this.RsNumber == null) ? 1 : this.RsNumber.GetHashCode()) *
                            ((this.Chromosome == null) ? 1 : this.Chromosome.GetHashCode()) *
                            ((this.Position == null) ? 1 : this.Position.GetHashCode());
            }

            return hashCode;
        }

        //[NotNullValidator]
        //[StringLengthValidator(1, RangeBoundaryType.Inclusive, 1, RangeBoundaryType.Ignore)]
        public string MarkerName { get; set; }

        //[TypeConversionValidator(typeof(int), Ruleset = "Automatic")]
        public string RsNumber { get; set; }

        //[ChromosomeValidation(Ruleset = "Manual")]
        public string Chromosome { get; set; }

        //[TypeConversionValidator(typeof(long), Ruleset = "Manual")]
        public string Position { get; set; }
    }
}
